package cauca.scsn.modelo.entidad;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import cauca.scsn.modelo.entidad.id.EjeId;

/**
 * Eje entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "eje", schema = "public")
public class Eje extends EntidadGenerica {

	// Fields

	private EjeId id;
	private EsquemaEje esquemaEje;
	private String tipoEje;

	// Constructors

	/** default constructor */
	public Eje() {
	}

	/** full constructor */
	public Eje(EjeId id, EsquemaEje esquemaEje, String tipoEje, String status) {
		this.id = id;
		this.esquemaEje = esquemaEje;
		this.tipoEje = tipoEje;
		this.status = status;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "posicion", column = @Column(name = "posicion", nullable = false)),
			@AttributeOverride(name = "idEsquemaEje", column = @Column(name = "id_esquema_eje", nullable = false)) })
	public EjeId getId() {
		return this.id;
	}

	public void setId(EjeId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_esquema_eje", nullable = false, insertable = false, updatable = false)
	public EsquemaEje getEsquemaEje() {
		return this.esquemaEje;
	}

	public void setEsquemaEje(EsquemaEje esquemaEje) {
		this.esquemaEje = esquemaEje;
	}

	@Column(name = "tipo_eje", nullable = false, length = 1)
	public String getTipoEje() {
		return this.tipoEje;
	}

	public void setTipoEje(String tipoEje) {
		this.tipoEje = tipoEje;
	}

	@Column(name = "status", nullable = false, length = 1)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Override
	public Object getPrimaryKey() {
		return this.id;
	}

	@Override
	public String toString() {
		return null;
	}

}